[id].vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <template>
  2. <div>
  3. <div class="inner--headers">
  4. <h2>{{ pageId }}</h2>
  5. <div class="bread--crumbs--wrap">
  6. <span>홈</span>
  7. <span @click="goBack" class="breadcrumb-link">벤더사 관리</span>
  8. <span>{{ currentVendor?.name || '벤더사 상세' }}</span>
  9. </div>
  10. </div>
  11. <!-- 로딩 상태 -->
  12. <div v-if="vendorsStore.getLoading.value" class="loading-wrap">
  13. <v-progress-circular indeterminate color="primary" size="64"></v-progress-circular>
  14. <p>벤더사 정보를 불러오고 있습니다...</p>
  15. </div>
  16. <!-- 에러 상태 -->
  17. <div v-else-if="vendorsStore.getError.value" class="error-wrap">
  18. <v-alert type="error" dismissible @click:close="vendorsStore.clearError()">
  19. {{ vendorsStore.getError.value }}
  20. </v-alert>
  21. <v-btn @click="goBack" class="custom-btn btn-blue">목록으로 돌아가기</v-btn>
  22. </div>
  23. <!-- 벤더사 상세 정보 -->
  24. <div v-else-if="currentVendor" class="vendor-detail-wrap">
  25. <!-- 벤더사 기본 정보 -->
  26. <v-card class="vendor-header-card" elevation="2">
  27. <v-card-text>
  28. <div class="vendor-header">
  29. <div class="vendor-logo-section">
  30. <v-avatar size="80" class="vendor-logo-large">
  31. <v-img
  32. v-if="currentVendor.logo"
  33. :src="currentVendor.logo"
  34. :alt="currentVendor.name + ' 로고'"
  35. ></v-img>
  36. <div v-else class="no-logo-large">{{ currentVendor.name.charAt(0) }}</div>
  37. </v-avatar>
  38. </div>
  39. <div class="vendor-info-section">
  40. <h1 class="vendor-name">{{ currentVendor.name }}</h1>
  41. <div class="vendor-meta">
  42. <v-chip
  43. :color="getCategoryColor(currentVendor.category)"
  44. size="large"
  45. variant="outlined"
  46. class="mr-2"
  47. >
  48. {{ getCategoryName(currentVendor.category) }}
  49. </v-chip>
  50. <v-chip
  51. :color="currentVendor.status === 'ACTIVE' ? 'success' : 'error'"
  52. size="large"
  53. >
  54. {{ currentVendor.status === 'ACTIVE' ? '활성' : '비활성' }}
  55. </v-chip>
  56. </div>
  57. <p v-if="currentVendor.description" class="vendor-description">
  58. {{ currentVendor.description }}
  59. </p>
  60. </div>
  61. <div class="vendor-actions">
  62. <v-btn
  63. v-if="currentVendor.website"
  64. :href="currentVendor.website"
  65. target="_blank"
  66. class="custom-btn btn-white mr-2"
  67. prepend-icon="mdi-web"
  68. >
  69. 웹사이트
  70. </v-btn>
  71. <v-btn
  72. @click="goBack"
  73. class="custom-btn btn-blue"
  74. prepend-icon="mdi-arrow-left"
  75. >
  76. 목록으로
  77. </v-btn>
  78. </div>
  79. </div>
  80. </v-card-text>
  81. </v-card>
  82. <!-- 상세 정보 탭 -->
  83. <v-card class="detail-tabs-card" elevation="2">
  84. <v-tabs v-model="activeTab" class="custom-tabs">
  85. <v-tab value="info">기업 정보</v-tab>
  86. <v-tab value="contact">연락처</v-tab>
  87. <v-tab value="products">제품 정보</v-tab>
  88. <v-tab value="partnership">파트너십</v-tab>
  89. </v-tabs>
  90. <v-card-text>
  91. <v-tabs-window v-model="activeTab">
  92. <!-- 기업 정보 탭 -->
  93. <v-tabs-window-item value="info">
  94. <div class="info-section">
  95. <v-row>
  96. <v-col cols="12" md="6">
  97. <div class="info-item">
  98. <h3>사업자등록번호</h3>
  99. <p>{{ currentVendor.businessNumber || '-' }}</p>
  100. </div>
  101. </v-col>
  102. <v-col cols="12" md="6">
  103. <div class="info-item">
  104. <h3>설립일</h3>
  105. <p>{{ formatDate(currentVendor.establishedDate) || '-' }}</p>
  106. </div>
  107. </v-col>
  108. <v-col cols="12" md="6">
  109. <div class="info-item">
  110. <h3>직원 수</h3>
  111. <p>{{ currentVendor.employeeCount ? currentVendor.employeeCount + '명' : '-' }}</p>
  112. </div>
  113. </v-col>
  114. <v-col cols="12" md="6">
  115. <div class="info-item">
  116. <h3>연매출</h3>
  117. <p>{{ formatCurrency(currentVendor.annualRevenue) || '-' }}</p>
  118. </div>
  119. </v-col>
  120. <v-col cols="12">
  121. <div class="info-item">
  122. <h3>사업 분야</h3>
  123. <div class="business-areas">
  124. <v-chip
  125. v-for="area in currentVendor.businessAreas || []"
  126. :key="area"
  127. size="small"
  128. variant="outlined"
  129. class="mr-2 mb-2"
  130. >
  131. {{ area }}
  132. </v-chip>
  133. </div>
  134. </div>
  135. </v-col>
  136. </v-row>
  137. </div>
  138. </v-tabs-window-item>
  139. <!-- 연락처 탭 -->
  140. <v-tabs-window-item value="contact">
  141. <div class="contact-section">
  142. <v-row>
  143. <v-col cols="12" md="6">
  144. <v-card variant="outlined" class="contact-card">
  145. <v-card-title>
  146. <v-icon class="mr-2">mdi-account</v-icon>
  147. 주요 담당자
  148. </v-card-title>
  149. <v-card-text>
  150. <div class="contact-item">
  151. <strong>이름:</strong> {{ currentVendor.contactName || '-' }}
  152. </div>
  153. <div class="contact-item">
  154. <strong>직책:</strong> {{ currentVendor.contactPosition || '-' }}
  155. </div>
  156. <div class="contact-item">
  157. <strong>전화:</strong>
  158. <a v-if="currentVendor.contactPhone" :href="`tel:${currentVendor.contactPhone}`">
  159. {{ currentVendor.contactPhone }}
  160. </a>
  161. <span v-else>-</span>
  162. </div>
  163. <div class="contact-item">
  164. <strong>이메일:</strong>
  165. <a v-if="currentVendor.contactEmail" :href="`mailto:${currentVendor.contactEmail}`">
  166. {{ currentVendor.contactEmail }}
  167. </a>
  168. <span v-else>-</span>
  169. </div>
  170. </v-card-text>
  171. </v-card>
  172. </v-col>
  173. <v-col cols="12" md="6">
  174. <v-card variant="outlined" class="contact-card">
  175. <v-card-title>
  176. <v-icon class="mr-2">mdi-map-marker</v-icon>
  177. 주소 정보
  178. </v-card-title>
  179. <v-card-text>
  180. <div class="contact-item">
  181. <strong>주소:</strong>
  182. <p>{{ currentVendor.address || '-' }}</p>
  183. </div>
  184. <div class="contact-item">
  185. <strong>상세주소:</strong>
  186. <p>{{ currentVendor.detailAddress || '-' }}</p>
  187. </div>
  188. <div class="contact-item">
  189. <strong>우편번호:</strong> {{ currentVendor.zipCode || '-' }}
  190. </div>
  191. </v-card-text>
  192. </v-card>
  193. </v-col>
  194. </v-row>
  195. </div>
  196. </v-tabs-window-item>
  197. <!-- 제품 정보 탭 -->
  198. <v-tabs-window-item value="products">
  199. <div class="products-section">
  200. <div class="section-header">
  201. <h3>주요 제품/서비스</h3>
  202. </div>
  203. <v-row v-if="currentVendor.products && currentVendor.products.length > 0">
  204. <v-col
  205. v-for="product in currentVendor.products"
  206. :key="product.id"
  207. cols="12"
  208. md="6"
  209. lg="4"
  210. >
  211. <v-card class="product-card" variant="outlined">
  212. <v-img
  213. v-if="product.image"
  214. :src="product.image"
  215. height="150"
  216. cover
  217. ></v-img>
  218. <v-card-title>{{ product.name }}</v-card-title>
  219. <v-card-text>
  220. <p>{{ product.description }}</p>
  221. <div class="product-price" v-if="product.price">
  222. {{ formatCurrency(product.price) }}
  223. </div>
  224. </v-card-text>
  225. </v-card>
  226. </v-col>
  227. </v-row>
  228. <div v-else class="no-data">
  229. <v-icon size="48" color="grey-lighten-1">mdi-package-variant</v-icon>
  230. <p>등록된 제품 정보가 없습니다</p>
  231. </div>
  232. </div>
  233. </v-tabs-window-item>
  234. <!-- 파트너십 탭 -->
  235. <v-tabs-window-item value="partnership">
  236. <div class="partnership-section">
  237. <v-row>
  238. <v-col cols="12" md="6">
  239. <div class="info-item">
  240. <h3>파트너십 등급</h3>
  241. <v-chip
  242. :color="getPartnershipColor(currentVendor.partnershipLevel)"
  243. size="large"
  244. >
  245. {{ getPartnershipName(currentVendor.partnershipLevel) }}
  246. </v-chip>
  247. </div>
  248. </v-col>
  249. <v-col cols="12" md="6">
  250. <div class="info-item">
  251. <h3>협력 시작일</h3>
  252. <p>{{ formatDate(currentVendor.partnershipStartDate) || '-' }}</p>
  253. </div>
  254. </v-col>
  255. <v-col cols="12" md="6">
  256. <div class="info-item">
  257. <h3>협력 프로젝트 수</h3>
  258. <p>{{ currentVendor.projectCount || 0 }}개</p>
  259. </div>
  260. </v-col>
  261. <v-col cols="12" md="6">
  262. <div class="info-item">
  263. <h3>평점</h3>
  264. <div class="rating">
  265. <v-rating
  266. v-model="currentVendor.rating"
  267. readonly
  268. size="small"
  269. density="compact"
  270. ></v-rating>
  271. <span class="rating-text">{{ currentVendor.rating || 0 }}/5</span>
  272. </div>
  273. </div>
  274. </v-col>
  275. <v-col cols="12">
  276. <div class="info-item">
  277. <h3>특이사항</h3>
  278. <p>{{ currentVendor.notes || '특이사항이 없습니다.' }}</p>
  279. </div>
  280. </v-col>
  281. </v-row>
  282. </div>
  283. </v-tabs-window-item>
  284. </v-tabs-window>
  285. </v-card-text>
  286. </v-card>
  287. </div>
  288. <!-- 데이터가 없을 때 -->
  289. <div v-else class="no-data-wrap">
  290. <div class="no-data">
  291. <v-icon size="64" color="grey-lighten-1">mdi-store-alert</v-icon>
  292. <h3>벤더사 정보를 찾을 수 없습니다</h3>
  293. <p>요청하신 벤더사가 존재하지 않거나 삭제되었을 수 있습니다</p>
  294. <v-btn @click="goBack" class="custom-btn btn-blue">목록으로 돌아가기</v-btn>
  295. </div>
  296. </div>
  297. </div>
  298. </template>
  299. <script setup>
  300. import { ref, onMounted, computed } from 'vue'
  301. import { useRoute, useRouter } from 'vue-router'
  302. import { useVendorsStore } from '@/stores/vendors'
  303. /************************************************************************
  304. | 레이아웃
  305. ************************************************************************/
  306. definePageMeta({
  307. layout: "default",
  308. })
  309. /************************************************************************
  310. | 스토어, 라우터, 라우트
  311. ************************************************************************/
  312. const vendorsStore = useVendorsStore()
  313. const router = useRouter()
  314. const route = useRoute()
  315. /************************************************************************
  316. | 반응형 데이터
  317. ************************************************************************/
  318. const pageId = ref("벤더사 상세")
  319. const activeTab = ref("info")
  320. /************************************************************************
  321. | computed
  322. ************************************************************************/
  323. const currentVendor = computed(() => vendorsStore.getCurrentVendor.value)
  324. /************************************************************************
  325. | 메서드
  326. ************************************************************************/
  327. const goBack = () => {
  328. router.push('/view/vendor/vendors')
  329. }
  330. const getCategoryColor = (category) => {
  331. const colors = {
  332. 'FASHION_BEAUTY': 'pink',
  333. 'FOOD_HEALTH': 'green',
  334. 'LIFESTYLE': 'blue',
  335. 'TECH_ELECTRONICS': 'purple',
  336. 'SPORTS_LEISURE': 'orange',
  337. 'CULTURE_ENTERTAINMENT': 'red'
  338. }
  339. return colors[category] || 'grey'
  340. }
  341. const getCategoryName = (category) => {
  342. const names = {
  343. 'FASHION_BEAUTY': '패션·뷰티',
  344. 'FOOD_HEALTH': '식품·건강',
  345. 'LIFESTYLE': '라이프스타일',
  346. 'TECH_ELECTRONICS': '테크·가전',
  347. 'SPORTS_LEISURE': '스포츠·레저',
  348. 'CULTURE_ENTERTAINMENT': '문화·엔터테인먼트'
  349. }
  350. return names[category] || category
  351. }
  352. const getPartnershipColor = (level) => {
  353. const colors = {
  354. 'PLATINUM': 'purple',
  355. 'GOLD': 'amber',
  356. 'SILVER': 'grey',
  357. 'BRONZE': 'brown',
  358. 'BASIC': 'blue-grey'
  359. }
  360. return colors[level] || 'grey'
  361. }
  362. const getPartnershipName = (level) => {
  363. const names = {
  364. 'PLATINUM': '플래티넘',
  365. 'GOLD': '골드',
  366. 'SILVER': '실버',
  367. 'BRONZE': '브론즈',
  368. 'BASIC': '베이직'
  369. }
  370. return names[level] || level
  371. }
  372. const formatDate = (dateString) => {
  373. if (!dateString) return null
  374. return new Date(dateString).toLocaleDateString('ko-KR')
  375. }
  376. const formatCurrency = (amount) => {
  377. if (!amount) return null
  378. return new Intl.NumberFormat('ko-KR', {
  379. style: 'currency',
  380. currency: 'KRW'
  381. }).format(amount)
  382. }
  383. /************************************************************************
  384. | 라이프사이클
  385. ************************************************************************/
  386. onMounted(async () => {
  387. const vendorId = route.params.id
  388. if (vendorId) {
  389. await vendorsStore.getVendorById(vendorId)
  390. }
  391. })
  392. </script>
  393. <style scoped>
  394. .vendor-detail-wrap {
  395. display: flex;
  396. flex-direction: column;
  397. gap: 20px;
  398. }
  399. .vendor-header-card {
  400. margin-bottom: 20px;
  401. }
  402. .vendor-header {
  403. display: flex;
  404. align-items: flex-start;
  405. gap: 20px;
  406. }
  407. .vendor-logo-section {
  408. flex-shrink: 0;
  409. }
  410. .vendor-logo-large {
  411. border: 1px solid #e0e0e0;
  412. }
  413. .no-logo-large {
  414. background: #f5f5f5;
  415. color: #666;
  416. font-weight: bold;
  417. font-size: 32px;
  418. display: flex;
  419. align-items: center;
  420. justify-content: center;
  421. width: 100%;
  422. height: 100%;
  423. }
  424. .vendor-info-section {
  425. flex: 1;
  426. }
  427. .vendor-name {
  428. font-size: 28px;
  429. font-weight: bold;
  430. margin-bottom: 12px;
  431. }
  432. .vendor-meta {
  433. margin-bottom: 16px;
  434. }
  435. .vendor-description {
  436. color: #666;
  437. line-height: 1.6;
  438. margin: 0;
  439. }
  440. .vendor-actions {
  441. flex-shrink: 0;
  442. }
  443. .breadcrumb-link {
  444. cursor: pointer;
  445. color: #1976d2;
  446. }
  447. .breadcrumb-link:hover {
  448. text-decoration: underline;
  449. }
  450. .detail-tabs-card {
  451. margin-top: 20px;
  452. }
  453. .info-section,
  454. .contact-section,
  455. .products-section,
  456. .partnership-section {
  457. padding: 20px 0;
  458. }
  459. .info-item {
  460. margin-bottom: 24px;
  461. }
  462. .info-item h3 {
  463. font-size: 16px;
  464. font-weight: 600;
  465. margin-bottom: 8px;
  466. color: #333;
  467. }
  468. .info-item p {
  469. font-size: 14px;
  470. color: #666;
  471. margin: 0;
  472. }
  473. .contact-card {
  474. height: 100%;
  475. }
  476. .contact-item {
  477. margin-bottom: 12px;
  478. }
  479. .contact-item strong {
  480. display: inline-block;
  481. width: 80px;
  482. color: #333;
  483. }
  484. .contact-item a {
  485. color: #1976d2;
  486. text-decoration: none;
  487. }
  488. .contact-item a:hover {
  489. text-decoration: underline;
  490. }
  491. .section-header {
  492. margin-bottom: 20px;
  493. padding-bottom: 10px;
  494. border-bottom: 1px solid #e0e0e0;
  495. }
  496. .section-header h3 {
  497. font-size: 18px;
  498. font-weight: 600;
  499. margin: 0;
  500. }
  501. .product-card {
  502. height: 100%;
  503. }
  504. .product-price {
  505. font-weight: bold;
  506. color: #1976d2;
  507. margin-top: 8px;
  508. }
  509. .rating {
  510. display: flex;
  511. align-items: center;
  512. gap: 8px;
  513. }
  514. .rating-text {
  515. font-size: 14px;
  516. color: #666;
  517. }
  518. .business-areas {
  519. display: flex;
  520. flex-wrap: wrap;
  521. gap: 8px;
  522. }
  523. .loading-wrap,
  524. .error-wrap,
  525. .no-data-wrap {
  526. display: flex;
  527. flex-direction: column;
  528. align-items: center;
  529. justify-content: center;
  530. padding: 60px 20px;
  531. }
  532. .no-data {
  533. text-align: center;
  534. }
  535. .no-data h3 {
  536. margin: 16px 0 8px;
  537. color: #666;
  538. }
  539. .no-data p {
  540. color: #999;
  541. margin-bottom: 20px;
  542. }
  543. @media (max-width: 768px) {
  544. .vendor-header {
  545. flex-direction: column;
  546. }
  547. .vendor-actions {
  548. width: 100%;
  549. }
  550. }
  551. </style>